package com.jinit.jia.boot.autoconfigure;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

/**
 * SpringBootApplication
 *
 * @author JInit
 * @date 2021-08-04
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited

@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan
public @interface SpringBootApplication {

    /**
     * 根据class来排除特定的类
     * 参数value类型是class类型
     * @return
     */
    @AliasFor(annotation = EnableAutoConfiguration.class)
    Class<?>[] exclude() default {};

    /**
     * 根据classname 来排除特定的类
     * 类型是class的全类名字符串数组
     */
    @AliasFor(annotation = EnableAutoConfiguration.class)
    String[] excludeName() default {};

    /**
     * 指定扫描包，参数是包名的字符串数组
     */
    @AliasFor(annotation = ComponentScan.class, attribute = "basePackages")
    String[] scanBasePackages() default {};

    /**
     * 扫描特定的包，参数类似是Class类型数组
     * @return
     */
    @AliasFor(annotation = ComponentScan.class, attribute = "basePackageClasses")
    Class<?>[] scanBasePackageClasses() default {};

    /**
     * proxyBeanMethods配置类是用来指定@Bean注解标注的方法是否使用代理
     * 默认true
     */
    @AliasFor(annotation = Configuration.class)
    boolean proxyBeanMethods() default true;

}
